package uy.edu.um.ltic.server.business;

import java.sql.Timestamp;
import java.util.ArrayList;

import uy.edu.um.ltic.commons.EmployeeVO;
import uy.edu.um.ltic.commons.MessageVO;

public class TextMessage extends Message{

	private String text;
	
	public TextMessage(Timestamp d, ArrayList<Employee> r, Employee s, String t){
		super(d, r, s);
		text = t;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	
	public MessageVO convertToMessageVO(){
		ArrayList<EmployeeVO> oLVO = new ArrayList<EmployeeVO>();
 		for (Employee emp : getReceivers()){
			oLVO.add(emp.convertToEmployeeVO());
		}
		return new MessageVO(this.getDate(), oLVO, this.getSender().convertToEmployeeVO(), this.text,null,null,1,null);
	}
}
